優化程式碼


Posted by mijouhsieh on 2023-04-03

  • 藏在實作細節裡的各種 JavaScript 進階觀念與技巧
  • 良好的程式碼撰寫風格,例如函式的拆解與命名
  • 使用 MVC 模式來管理程式碼
  • 使用狀態來控制程式流程

模組化程式碼:MVC (Model-View-Controller) 模式來分類程式碼。


const model = {
  // 和資料有關的程式碼
}
const view = {
  // 和介面有關的程式碼
}
const controller = {
  // 和流程有關的程式碼
}









Related Posts

redis 套件的 Property 'on' does not exist on type 'RedisClientType'

redis 套件的 Property 'on' does not exist on type 'RedisClientType'

Git 筆記 - 將本地專案推送至別的儲存庫同步

Git 筆記 - 將本地專案推送至別的儲存庫同步

Line聊天機器人---本機電腦的練習

Line聊天機器人---本機電腦的練習


Comments